package com.ftg.learn.util;

import com.github.pagehelper.PageInfo;

/**
 * @author 布衣
 */
public class PageUtils {

    public static <T> PageEx<T> convertToPageEx(PageInfo<T> pageInfo, Integer page, Integer size) {
        PageEx<T> pageEx = new PageEx<>(page, size);
        pageEx.setCount((int) pageInfo.getTotal());
        pageEx.setRows(pageInfo.getList());
        pageEx.setTotalPage(pageInfo.getPages());
        return pageEx;
    }


}
